package com.whcoding.encrypt.entity;

import lombok.ToString;

/**
 * @program: spring-boot-learning
 * @description:返回类
 * @author: whcoding
 * @create: 2022-06-16 11:32
 **/
@ToString
public class RespBeanVO {
	private Integer status;
	private String msg;
	private Object obj;

	public static RespBeanVO build() {
		return new RespBeanVO();
	}

	public static RespBeanVO ok(String msg) {
		return new RespBeanVO(200, msg, null);
	}

	public static RespBeanVO ok(String msg, Object obj) {
		return new RespBeanVO(200, msg, obj);
	}

	public static RespBeanVO error(String msg) {
		return new RespBeanVO(500, msg, null);
	}

	public static RespBeanVO error(String msg, Object obj) {
		return new RespBeanVO(500, msg, obj);
	}

	private RespBeanVO() {
	}

	private RespBeanVO(Integer status, String msg, Object obj) {
		this.status = status;
		this.msg = msg;
		this.obj = obj;
	}

	public Integer getStatus() {
		return status;
	}

	public RespBeanVO setStatus(Integer status) {
		this.status = status;
		return this;
	}

	public String getMsg() {
		return msg;
	}

	public RespBeanVO setMsg(String msg) {
		this.msg = msg;
		return this;
	}

	public Object getObj() {
		return obj;
	}

	public RespBeanVO setObj(Object obj) {
		this.obj = obj;
		return this;
	}

}
